const app = getApp()
import {
  imageUrl
} from "../../utils/imageutil.js"
Page({
  data: {
    imageUrl,
    userInfo: wx.getStorageSync('userInfo'),
    page: 1,
    type: '',
    list: []
  },
  onLoad: function (options) {
    this.setData({
      type: options.type,
      userInfo: wx.getStorageSync('userInfo')
    })
    this.getCollectionList()
  },
  getCollectionList() {
    app.globalData.post({
      data: {
        do: 'CollectionList',
        page: this.data.page,
        pagesize: 10,
        type: this.data.type,
        uid: wx.getStorageSync('userInfo').id
      }
    }).then(res => {
      this.setData({
        list: res.data.data
      })
    })
  },
  changebtn() {
    wx.navigateBack({
      delta: 1
    })
  },
  to_perfection() {
    wx.navigateTo({
      url: './perfection',
    })
  },
  to_aunt(e) {
    wx.navigateTo({
      url: '../aunt/index?uid=' + e.currentTarget.dataset.id,
    })
  },
})